<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!-- 引入标签库-->
<%@ include file="/pages/inc/taglibs.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>文档修改</title>
<%@ include file="/pages/inc/header.jsp" %>
<script type="text/javascript">
<%@ include file="/js/extends/jquery.form.js" %>
<%@ include file="/pages/jsp/commom/validator.js" %>
<%@ include file="/pages/jsp/docInfo/docInfoDataEdit.js" %>
</script>
</head>
<body>
<div class="main"">
	<form id="docInfoForm">
	<input type="hidden" id="id" name="id" value="<c:out value='${affDocument.id}'/>">
	<table class="inputTable" cellpadding="0" cellspacing="0" style="height: 100%;">
		<tr>
			<td class="staticTd" style="width: 15%;">标题：</td>
			<td class="dynamicTd" style="width: 85%;">
				<input id="title" name="title" type="text" value="<c:out value='${affDocument.title}'/>" style="min-width: 152px;" />
			</td>
		</tr>
		<tr>
			<td class="staticTd">文档目录：</td>
			<td class="dynamicTd">
				<input id="catalogId" name="catalogId" value="<c:out value='${affDocument.catalogId}'/>" type="hidden" />
				<input id="permissionType" name="permissionType" value="<c:out value='${affDocument.permissionType}'/>" type="hidden" />
				<c:out value='${catalogName}'/>
			</td>
		</tr>
		<tr>
			<td class="staticTd">文件：</td>
			<td class="dynamicTd">
				<a href='<c:url value='/docInfo/downLoadFile' />?docId=<c:out value='${affDocument.id}'/>'>附件</a>
			</td>
		</tr>
		
		<c:if test="${not empty docClassList}">
			<c:forEach  var="bean" items="${ docClassList }" varStatus="s">
				<tr>
					<td class="staticTd"><c:out value='${bean.name}'/>：</td>
					<td class="dynamicTd">
					    <c:choose>
					       <c:when test="${bean.num == 1 && null != affDocument.ext1 && '' != affDocument.ext1}">
					       		<input id="docClassNames<c:out value='${s.index}'/>" name="docClassNames" type="text" onclick="openTree('<c:out value='${s.index}'/>','<c:out value='${bean.num}'/>','<c:out value='${bean.id}'/>');" value="<c:out value='${affDocument.extName1}'/>"/>
								<input id="docClassIds<c:out value='${s.index}'/>" name="docClassIds" type="hidden" value="<c:out value='${affDocument.ext1}'/>_<c:out value='${bean.num}'/>"/>
					       </c:when>
					       <c:when test="${bean.num == 2 && null != affDocument.ext2 && '' != affDocument.ext2}">
					       		<input id="docClassNames<c:out value='${s.index}'/>" name="docClassNames" type="text" onclick="openTree('<c:out value='${s.index}'/>','<c:out value='${bean.num}'/>','<c:out value='${bean.id}'/>');" value="<c:out value='${affDocument.extName2}'/>"/>
								<input id="docClassIds<c:out value='${s.index}'/>" name="docClassIds" type="hidden" value="<c:out value='${affDocument.ext2}'/>_<c:out value='${bean.num}'/>"/>
					       </c:when>
					       <c:when test="${bean.num == 3 && null != affDocument.ext3 && '' != affDocument.ext3}">
					       		<input id="docClassNames<c:out value='${s.index}'/>" name="docClassNames" type="text" onclick="openTree('<c:out value='${s.index}'/>','<c:out value='${bean.num}'/>','<c:out value='${bean.id}'/>');" value="<c:out value='${affDocument.extName3}'/>"/>
								<input id="docClassIds<c:out value='${s.index}'/>" name="docClassIds" type="hidden" value="<c:out value='${affDocument.ext3}'/>_<c:out value='${bean.num}'/>"/>
					       </c:when>
					       <c:when test="${bean.num == 4 && null != affDocument.ext4 && '' != affDocument.ext4}">
					       		<input id="docClassNames<c:out value='${s.index}'/>" name="docClassNames" type="text" onclick="openTree('<c:out value='${s.index}'/>','<c:out value='${bean.num}'/>','<c:out value='${bean.id}'/>');" value="<c:out value='${affDocument.extName4}'/>"/>
								<input id="docClassIds<c:out value='${s.index}'/>" name="docClassIds" type="hidden" value="<c:out value='${affDocument.ext4}'/>_<c:out value='${bean.num}'/>"/>
					       </c:when>
					       <c:when test="${bean.num == 5 && null != affDocument.ext5 && '' != affDocument.ext5}">
					       		<input id="docClassNames<c:out value='${s.index}'/>" name="docClassNames" type="text" onclick="openTree('<c:out value='${s.index}'/>','<c:out value='${bean.num}'/>','<c:out value='${bean.id}'/>');" value="<c:out value='${affDocument.extName5}'/>"/>
								<input id="docClassIds<c:out value='${s.index}'/>" name="docClassIds" type="hidden" value="<c:out value='${affDocument.ext5}'/>_<c:out value='${bean.num}'/>"/>
					       </c:when>
					       <c:when test="${bean.num == 6 && null != affDocument.ext6 && '' != affDocument.ext6}">
					       		<input id="docClassNames<c:out value='${s.index}'/>" name="docClassNames" type="text" onclick="openTree('<c:out value='${s.index}'/>','<c:out value='${bean.num}'/>','<c:out value='${bean.id}'/>');" value="<c:out value='${affDocument.extName6}'/>"/>
								<input id="docClassIds<c:out value='${s.index}'/>" name="docClassIds" type="hidden" value="<c:out value='${affDocument.ext6}'/>_<c:out value='${bean.num}'/>"/>
					       </c:when>
					       <c:when test="${bean.num == 7 && null != affDocument.ext7 && '' != affDocument.ext7}">
					       		<input id="docClassNames<c:out value='${s.index}'/>" name="docClassNames" type="text" onclick="openTree('<c:out value='${s.index}'/>','<c:out value='${bean.num}'/>','<c:out value='${bean.id}'/>');" value="<c:out value='${affDocument.extName7}'/>"/>
								<input id="docClassIds<c:out value='${s.index}'/>" name="docClassIds" type="hidden" value="<c:out value='${affDocument.ext7}'/>_<c:out value='${bean.num}'/>"/>
					       </c:when>
					       <c:when test="${bean.num == 8 && null != affDocument.ext8 && '' != affDocument.ext8}">
					       		<input id="docClassNames<c:out value='${s.index}'/>" name="docClassNames" type="text" onclick="openTree('<c:out value='${s.index}'/>','<c:out value='${bean.num}'/>','<c:out value='${bean.id}'/>');" value="<c:out value='${affDocument.extName8}'/>"/>
								<input id="docClassIds<c:out value='${s.index}'/>" name="docClassIds" type="hidden" value="<c:out value='${affDocument.ext8}'/>_<c:out value='${bean.num}'/>"/>
					       </c:when>
					       <c:when test="${bean.num == 9 && null != affDocument.ext9 && '' != affDocument.ext9}">
					       		<input id="docClassNames<c:out value='${s.index}'/>" name="docClassNames" type="text" onclick="openTree('<c:out value='${s.index}'/>','<c:out value='${bean.num}'/>','<c:out value='${bean.id}'/>');" value="<c:out value='${affDocument.extName9}'/>"/>
								<input id="docClassIds<c:out value='${s.index}'/>" name="docClassIds" type="hidden" value="<c:out value='${affDocument.ext9}'/>_<c:out value='${bean.num}'/>"/>
					       </c:when>
					       <c:when test="${bean.num == 10 && null != affDocument.ext10 && '' != affDocument.ext10}">
					       		<input id="docClassNames<c:out value='${s.index}'/>" name="docClassNames" type="text" onclick="openTree('<c:out value='${s.index}'/>','<c:out value='${bean.num}'/>','<c:out value='${bean.id}'/>');" value="<c:out value='${affDocument.extName10}'/>"/>
								<input id="docClassIds<c:out value='${s.index}'/>" name="docClassIds" type="hidden" value="<c:out value='${affDocument.ext10}'/>_<c:out value='${bean.num}'/>"/>
					       </c:when>
					       <c:otherwise>
					       		<input id="docClassNames<c:out value='${s.index}'/>" name="docClassNames" type="text" onclick="openTree('<c:out value='${s.index}'/>','<c:out value='${bean.num}'/>','<c:out value='${bean.id}'/>');" value=""/>
								<input id="docClassIds<c:out value='${s.index}'/>" name="docClassIds" type="hidden" value=""/>
					       </c:otherwise>
						</c:choose>
						
					</td>
				</tr>
			</c:forEach>
		</c:if>	
		
		<tr>
			<td class="staticTd">文档摘要：</td>
			<td class="dynamicTd">
			  <textarea id="description" name="description" style="width:98%;height:50px;"><c:out value='${affDocument.description}'/></textarea>
			</td>
		</tr>
		<tfoot>
			<td class="footTd" colspan="2">
				<div class="inlineBlock"> 
		            <a id="saveButton" >保存</a>
		        </div>
			</td>
		</tfoot>
	</table>
	</form>
</div>
</body>
</html>